using System.Collections.Generic;
using System.Net;
using CodePlex.TfsLibrary.RegistrationWebSvc;

namespace CodePlex.UnitTestUtility
{
    public class StubRegistrationWebSvc : IRegistrationWebSvc
    {
        public List<RegistrationEntry> Entries = new List<RegistrationEntry>();
        string url;

        public StubRegistrationWebSvc()
        {
            ServiceInterface iface = new ServiceInterface();
            iface.Name = "Bar";
            iface.Url = "/Fooble.asmx";

            RegistrationEntry entry = new RegistrationEntry();
            entry.Type = "Foo";
            entry.ServiceInterfaces = new ServiceInterface[1] { iface };

            Entries.Add(entry);
        }

        public ICredentials Credentials
        {
            get { return null; }
        }

        public string Url
        {
            get { return url; }
            set { url = value; }
        }

        public RegistrationEntry[] GetRegistrationEntries(string toolId)
        {
            return Entries.ToArray();
        }
    }
}